Skip to content

fix: prevent fragment FOUC by awaiting load before section reveal#77

Merged
kunwarsaluja merged 1 commit intomainfrom
fix/fragment-fouc
Mar 6, 2026
Merged

fix: prevent fragment FOUC by awaiting load before section reveal#77
kunwarsaluja merged 1 commit intomainfrom
fix/fragment-fouc

Conversation

@shsteimer
Copy link
Contributor

Summary

  • Move fragment loading from fire-and-forget in buildAutoBlocks to an awaitable loadFragments(section) callback passed to loadSection
  • Sections now wait for fragment content to load before becoming visible, preventing bare link flash
  • Restore sequential section loading (top-to-bottom) per boilerplate standard, replacing parallel Promise.all approach introduced in c455bed

Stacked on #76 — merge that first.

Test plan

  • Verify pages with auto-blocked fragments no longer flash bare links before content loads
  • Verify sections still reveal top-to-bottom sequentially
  • Verify #_dnb opt-out still works
  • Verify fragment block (non-auto-blocked) still works
  • Run PageSpeed on preview URL

Before/after: https://fix-fragment-fouc--diyfire--cloudadoption.aem.page

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

Move fragment loading from fire-and-forget in buildAutoBlocks to an
awaitable loadFragments(section) callback passed to loadSection. Sections
now wait for fragment content before becoming visible.

Also restores sequential section loading (top-to-bottom) per boilerplate
standard, replacing the parallel Promise.all approach.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@aem-code-sync
Copy link

aem-code-sync bot commented Mar 5, 2026

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

@aem-code-sync
Copy link

aem-code-sync bot commented Mar 5, 2026

Page Scores Audits Google
📱 / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ / PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@shsteimer shsteimer requested a review from kunwarsaluja March 5, 2026 21:50
Base automatically changed from fix/dark-mode-fouc to main March 6, 2026 13:09
@kunwarsaluja kunwarsaluja merged commit 41052f1 into main Mar 6, 2026
3 checks passed
@kunwarsaluja kunwarsaluja deleted the fix/fragment-fouc branch March 6, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants